package samples.bankleitzahlen;

import br.cin.ufpe.in1118.middleware.distribution.services.naming.Naming;
import br.cin.ufpe.in1118.middleware.distribution.services.naming.NamingService;
import br.cin.ufpe.in1118.middleware.exceptions.RemoteException;

public class BankleitzahlenClient {

	public static void main(String[] args) {
		Bankleitzahlen blz = null;
		Naming naming = NamingService.getNamingInstance("localhost", 9001);
		try {
			Object obj = naming.lookup(Bankleitzahlen.SERVICE_NAME);
			if (obj instanceof Bankleitzahlen) {
				blz = (Bankleitzahlen) obj;
			}
			Bank bank1 = blz.getBank("20041133");
			Bank bank2 = blz.getBank("18092744");
			System.out.println(bank1);
			System.out.println(bank2);
			
			blz.getBank("-1");
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}

}
